package com.job.blossom.work0712;

/**
 * @author ZJM
 * @version 1.0
 * @since 2022-07-12 19:29:00
 */
public class MainTiger {

    private String name;

//    关联策略接口
    private AttackWay attackWay;

    public void attack(){
//        当关联的策略类型 attackWay 被赋值时，实现不同的方法
        attackWay.attackMethod();
    }

    public MainTiger() {
    }

    public MainTiger(String name, AttackWay attackWay) {
        this.name = name;
        this.attackWay = attackWay;
    }
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public AttackWay getAttackWay() {
        return attackWay;
    }

    public void setAttackWay(AttackWay attackWay) {
        this.attackWay = attackWay;
    }
}
